<!DOCTYPE html>
<html>
	<head>
		<meta charset="UTF-8">
		<title></title>
		<script type="text/javascript">
			var array1 = new Array(7);
			console.log(array1.length)// 7
			var array2 = new Array(100, "a", true);;
			console.log(array2.length)// 3
			// 创建一个空数组，数组的长度是可变
			var array = new Array();
			array[0] = "232";
			console.log(array);// ["232"]
			console.log(array.length);// 1
			array[1] = true;
			console.log(array);// ["232", true]
			console.log(array.length);// 2
			
			// 使用push和pop分别对应栈操作的入栈和出栈
			// 对应到数组就是添加到数组和从数组移除
			var arr = new Array();
			arr.push("zhangsan");
			console.log(arr);// ["zhangsan"]
			arr.push(false);
			console.log(arr);// ["zhangsan", false]
			arr.push(34);
			console.log(arr);// ["zhangsan", false, 34]
			console.log(arr.pop());// 34
			console.log(arr.pop());// false
			console.log(arr.pop());// zhangsan
		</script>
	</head>
	<body>
	</body>
</html>
